<!DOCTYPE html>
<!-- 
Template Name: Metronic - Responsive Admin Dashboard Template build with Twitter Bootstrap 3.1.1
Version: 2.0.2
Author: KeenThemes
Website: http://www.keenthemes.com/
Contact: support@keenthemes.com
Purchase: http://themeforest.net/item/metronic-responsive-admin-dashboard-template/4021469?ref=keenthemes
License: You must have a valid license purchased only from themeforest(the above link) in order to legally use the theme for your project.
-->
<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!-->
<!--<![endif]-->
<!-- BEGIN HEAD -->
<!-- BEGIN BODY -->
<body class="page-header-fixed">
<!-- BEGIN CONTAINER -->
	<!-- BEGIN CONTENT -->
		<!--表格操作按钮组-->
		<div class="form-group" style="margin: 0px;">
			<div class="row">
				<div class="col-sm-4">
					<label class="col-sm-3 control-label text-right">卡状态</label>
					<div class="col-sm-9">
						<div class="input-group">
							<select ng-model="searchModel.state" class="form-control">
								<option value="">请选择</option>
								<option value="0">未激活</option>
								<option value="1">激活</option>
								<option value="2">冻结</option>
								<option value="3">挂失</option>
								<option value="4">注销</option>
							</select>
						</div>
					</div>
				</div>
				<div class="col-sm-5">
					<label class="col-sm-3 control-label text-right">制卡批次号</label>
					<div class="col-sm-9"><input type="text" class="form-control" ng-model="searchModel.batNo"/></div>
				</div>
				<div class="col-sm-1"><a class="btn blue" ng-click="queryOfflineAccount();"><i class="fa fa-search"></i>查询</a></div>
				<div class="col-sm-1"><a class="btn blue" ng-click="exportOfflineAccount();"><i class="fa fa-sign-out"></i>导出Excel</a></div>
			</div>
		</div>
		<hr />
		<div>
			<a class="btn blue" href="javascript:;"  data-target="#offlineAccountModel" 
				data-toggle="modal">
				<i class="fa fa-plus"></i>
					批量新增
			</a>
			<a class="btn blue" href="javascript:;"  ng-click="showBacthUpdateOfflineAccount();">
				<i class="fa fa-plus"></i>
					更新卡状态
			</a>
			
		</div>
			<table class="table table-striped table-bordered table-hover" id="table_1">
			<thead>
				<tr>
					<th class="table-checkbox">
						<input type="checkbox" class="checkbox_table" />
					</th>
					<th>卡号</th>
					<th>所属运营商</th>
					<th>余额</th>
					<th>制卡批次号</th>
					<th>卡状态</th>
				</tr>
			</thead>
			<tbody>
				<tr class="odd gradeX" ng-repeat="offlineAccount in offlineAccountList  track by $index" on-loaded="{{$last}}" target-table="table_1">
					<td>
						<input type="checkbox" class="checkboxes" value="{{$index}}" name="selectedModel" 
						  />
					</td>
					<td>
						<span ng-bind="offlineAccount.cardNo"></span>
					</td>
					<td>
						<span ng-bind="offlineAccount.merchantCode | getValueInArgFilter : merchantMap : 'name'"></span>
					</td>
					<td>
						<span ng-bind="offlineAccount.acctBal | number : 2"></span>
					</td>
					<td>
						<span ng-bind="offlineAccount.batNo"></span>
					</td>
					<td>
						<span ng-bind="offlineAccount.state | getValueInStaticFilter : 'cardStateArray'"></span>
					</td>
				</tr>
			</tbody>
			</table>
		
		<div id="offlineAccountModel" class="modal fade" role="dialog" aria-hidden="true" data-backdrop="false">
			<div class="modal-dialog">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
						<h4 class="modal-title">批量生成离线现金卡</h4>
					</div>
					<div class="modal-body form">
						<div class="form-group">
						<div class="row">
								<label class="col-sm-4 control-label text-right">运营商</label>
								<div class="col-sm-8">
									<div class="input-group">
										<select class="form-control  flexselect  bValidate" key="required"
											ng-options="merchant.merchantCode as merchant.shortName for merchant in validMerchantMap"
											ng-model="merchantCode">
											<option value=""></option>
										</select>
									</div>
								</div>
							</div>
							<div class="row">
								<label class="col-sm-4 control-label text-right">地区码(4位)</label>
								<div class="col-sm-8">
									<div class="input-group">
										<input type="text" class="form-control bValidate" key="required,number,minlength_4,maxlength_4" ng-model="areaCode"/>
									</div>
								</div>
							</div>
							<div class="row">
								<label class="col-sm-4 control-label text-right">制卡数量</label>
								<div class="col-sm-8">
									<div class="input-group">
										<input type="text" class="form-control bValidate" key="required,number" ng-model="createAmount"/>
									</div>
								</div>
							</div>
						</div>
					</div>
					<div class="modal-footer">
						<button type="button" class="btn btn-danger" data-dismiss="modal"><i class="fa fa-times"></i>关闭</button>
						<button type="button" class="btn btn-primary" ng-click="batchCreateOfflineAccount();"><i class="fa fa-check"></i>生成卡</button>
					</div>
				</div>
			</div>
		</div>
		<div id="offlineAccountStateModel" class="modal fade" role="dialog" aria-hidden="true" data-backdrop="false">
			<div class="modal-dialog">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
						<h4 class="modal-title">更新离线现金卡状态选择</h4>
					</div>
					<div class="modal-body form">
						<div class="row">
						<label class="col-sm-3 control-label text-right"></label>
						<div class="col-md-8">
							<div class="radio-list">
								<label class="radio-inline"><input type="radio"  value="1" ng-model="selectedState">激活</label>
								<label class="radio-inline"><input type="radio"  value="2" ng-model="selectedState">冻结</label>
								<label class="radio-inline"><input type="radio"  value="3" ng-model="selectedState">挂失</label>
								<label class="radio-inline"><input type="radio"  value="4" ng-model="selectedState">注销</label>
							</div>
						</div>
					</div>
					</div>
					<div class="modal-footer">
						<button type="button" class="btn btn-danger" data-dismiss="modal"><i class="fa fa-times"></i>关闭</button>
						<button type="button" class="btn btn-primary" ng-click="bacthUpdateOfflineAccount();"><i class="fa fa-check"></i>更新</button>
					</div>
				</div>
			</div>
		</div>

</div>
	<!-- END CONTENT -->

<!-- END CONTAINER -->

<!-- BEGIN JAVASCRIPTS(Load javascripts at bottom, this will reduce page load time) -->
<!-- BEGIN CORE PLUGINS -->



</body>
<!-- END BODY -->
</html>
<script src="manageView/assets/scripts/public.js" type="text/javascript"></script>
<script>

// setTimeout(function(){
// 	var tablesOption = datatableOption;
// var table1 = $('#table_1');
// var tb1 = table1.DataTable(tablesOption);
// }, 3000);

</script>